const path = require('path');
const Application = require('thinkjs');

const instance = new Application({
  ROOT_PATH: __dirname,
  APP_PATH: path.join(__dirname, 'app'),
  proxy: true, // use proxy
  env: 'production'
});

const Eureka = require('eureka-js-client').Eureka;

const client = new Eureka({
  filename: 'eureka-client',
  cwd: __dirname
});
console.log('object');
client.logger.level('debug');
client.start(function(error) {
  if (error) {
    console.log('Eureka注册失败！');
  } else {
    console.log(error || 'Eureka注册成功！');
  }
});

instance.run();
